package com.rover022.flixelgame.utils
{
	import com.bit101.components.Window;
	import flash.events.Event;

	public class MiniComponentTool
	{
		/**
		 * 这个类的设计是用在在没有界面的情况下快速生成一个UI给程序调用
		 *
		 */
		public function MiniComponentTool()
		{
		}

		/**
		 * 普通的的UI 目的是表示这个地方有Sprite显示
		 * @param name
		 * @return
		 *
		 */
		public static function getWindow(name:String):Window
		{
			var window:Window = new Window(null, 0, 0, name);
			window.setSize(300, 100);
			return window;
		}

		/**
		 * 弹出类的UI 目的是表示这个可以被关闭
		 * @param name
		 * @return
		 *
		 */
		public static function getPopWindow(name:String, func:Function):Window
		{
			var window:Window = new Window(null, 0, 0, name);
			window.setSize(400, 400);
			window.draggable = true;
			window.hasMinimizeButton = true;
			window.hasCloseButton = true;
			window.addEventListener(Event.CLOSE, func);
			window.x = 100;
			window.y = 100;
			return window;
		}
	}
}
